<template>
  <van-form @submit="onSubmit">
    <van-field
      v-for="(item, index) in visibleFeedTitles"
      :key="index"
      v-model="feedItem[item.field]"
      :name="item.title"
      :label="item.title"
      placeholder="请输入"
      :rules="[{ required: true, message: '请填写用户名' }]"
    />
    <div style="margin: 16px;">
      <van-button round block type="info" color="#d81e06" size="small" native-type="submit">提交</van-button>
    </div>
  </van-form>
</template>
<script>
/*
  提交周期反馈内容的组件  app端暂时没有提交功能
  demo
  <feecback-form-item
          v-if="(item.isSubmit === 0 || item.isReturnBack === 1) && item.orgId === loginPostInfo.orgId"
          :key="index"
          :feedItem="item"
          :feedTitles="titles"
        ></feecback-form-item>
*/
export default {
  name: 'FeecbackItem',
  components: {},
  props: {
    /* 反馈数据item */
    feedItem: {
      type: Object,
      default: () => {},
    },
    /* 反馈字段 */
    feedTitles: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {}
  },
  computed: {
    visibleFeedTitles() {
      return this.feedTitles.filter(item => item.visible)
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {},
}
</script>
<style lang="scss" scoped>
/deep/.van-form {
  background: #fff;
}
/deep/.van-cell {
  padding: 10px 16px;
}
</style>
